package com.pr.makfilm.core.cmp.authorization;

import org.apache.wicket.Application;
import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
import org.apache.wicket.markup.html.link.Link;

/**
 * Created with IntelliJ IDEA.
 * User: Pawel
 * Date: 21.03.13
 * Time: 22:27
 * To change this template use File | Settings | File Templates.
 */
public class LogoutLink extends Link
{
   public LogoutLink(String id)
   {
      super(id);
   }

   @Override
   public void onClick()
   {
      AuthenticatedWebSession session = AuthenticatedWebSession.get();
      session.invalidateNow();
      setResponsePage(Application.get().getHomePage());
   }
}
